package com.nlelpct.manage.service;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;

public interface IOssService {

    String BASE_URL = "/api/ucm/company/image/";


    static String composeImageUrl(String logoOssKey){
        return BASE_URL+logoOssKey;
    };

    String upload( String fileKey, File file);

    String upload( String fileKey, String originName, InputStream inputStream);

    Boolean delete( String fileKey);

    String download( String fileKey, Long expire);

    void download(String fileKey, HttpServletRequest request, HttpServletResponse response) throws IOException;

    File download(List<String> fileKeys) throws IOException;

    String download(String fileKey);

    //获取下载链接抽取方法
    String getUrlLinkToDownload( String fileKey, Long expire);

    Boolean isFileExist( String fileKey);

    String downLoadFile(String fileKey,String localFilePath);

    String uploadToOSS(File sourceFile, boolean isDeleteSourceFile, String fileKey);
}
